package com.atguigu.tingshu.es.demo.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * Author:huzhongkui
 * Date: 2025-03-15 星期六 13:53:36
 * Description:  Person未来和文档做映射
 */
@Document(indexName = "person")
@Data
public class Person {

    @Id
    private Long id;
    @Field(name = "name",type = FieldType.Text,index = true,analyzer = "ik_smart")
    private String name;
    @Field(name = "age",type = FieldType.Integer,index = true)
    private Integer age;
    @Field(name = "address",type = FieldType.Text,index = true,analyzer = "ik_smart")
    private String address;
}
